/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package zpsb.accounting.jsf;


import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import zpsb.accounting.model.User;
import zpsb.accounting.session.UserBean;

/**
 *
 * @author Michal
 */
@ManagedBean(name = "userController1")
@SessionScoped
public class UserController {

    @EJB
    private UserBean ub;
    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User u) {
        this.user = u;
    }

    public UserController() {
    }

    public String prepareCreate() {
        user = new User();
        return "register";
    }
    
    public String create() {
        ub.create(user);
        return "index";
    }
}
